home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
parallel
/
execlp.c
< prev
next >
Wrap
Text File
|
1992-04-11
|
2KB
|
68 lines
/*-------------------------------------------------------------------*/
/*----Upgrade to predu.c in muProlog to execlp. Needs additions to */
/*----init.c and init.h : */
/*----init.c - fassert(find(7,"execlp"), (Ptr) p_execlp, -1, 0); */
/*----init.h - ,p_execlp() */
/*---- */
/*----Usage :-execlp(+File_path,+Arg0,+Arg1,+Arg2,+Arg3,+Arg4). */
/*----i.e. Must have 5 command line arguments */
/*---- */
/*----Written by Geoff Sutcliffe 7/12/89 */
/*-------------------------------------------------------------------*/
p_execlp(t,l)
Ptr t;
levtype l;
{
Ptr t_file,t_arg0,t_arg1,t_arg2,t_arg3,t_arg4;
levtype l_file,l_arg0,l_arg1,l_arg2,l_arg3,l_arg4;
findbind((Ptr)targ(1,t),l,&t_file,&l_file);
if (!IsAtom(t_file))
{
plerror(EECONST);
return(ERROR);
}
findbind((Ptr)targ(2,t),l,&t_arg0,&l_arg0);
if (!IsAtom(t_arg0))
{
plerror(EECONST);
return(ERROR);
}
findbind((Ptr)targ(3,t),l,&t_arg1,&l_arg1);
if (!IsAtom(t_arg1))
{
plerror(EECONST);
return(ERROR);
}
findbind((Ptr)targ(4,t),l,&t_arg2,&l_arg2);
if (!IsAtom(t_arg2))
{
plerror(EECONST);
return(ERROR);
}
findbind((Ptr)targ(5,t),l,&t_arg3,&l_arg3);
if (!IsAtom(t_arg3))
{
plerror(EECONST);
return(ERROR);
}
findbind((Ptr)targ(6,t),l,&t_arg4,&l_arg4);
if (!IsAtom(t_arg4))
{
plerror(EECONST);
return(ERROR);
}
/*----The last argument is not working, don't know why */
execlp(dname(atdict(t_file)),dname(atdict(t_arg0)),dname(atdict(t_arg1)),
dname(atdict(t_arg2)),dname(atdict(t_arg3)),dname(atdict(t_arg4)),NULL);
return(FAIL);
}
/*-------------------------------------------------------------------*/